home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / POLY.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  270 b   |  11 lines

  1. /* poly.c from page233*/
  2. #include <stdio.h>
  3. #include <math.h>
  4.                     /*polynomial is: 3x**2 + 2x -1 */
  5. double c[] = {-1.0, 2.0, 3.0};
  6. main()
  7. {    double value_at_10;
  8.     value_at_10 = poly(10.0, 2, c);
  9.     printf("3x**2 + 2x -1 evaluated at 10.0 =%f\n",
  10.     value_at_10);
  11. }